Skip to content

Fix #8260 Improve check: Pointer calculation result not null#8061

Open
francois-berder wants to merge 2 commits intocppcheck-opensource:mainfrom
francois-berder:pr-8260
Open

Fix #8260 Improve check: Pointer calculation result not null#8061
francois-berder wants to merge 2 commits intocppcheck-opensource:mainfrom
francois-berder:pr-8260

Conversation

@francois-berder
Copy link
Copy Markdown
Collaborator

No description provided.

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

@pfultz2 pfultz2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be done in valueflow. If there is a plus with a non zero value on a pointer, it should be set to !0. This can probably be done in the valueFlowImpossibleValues pass.

Comment thread test/testcondition.cpp Outdated
…t not null

Signed-off-by: Francois Berder <fberder@outlook.fr>
@francois-berder
Copy link
Copy Markdown
Collaborator Author

@pfultz2 I finally had time to fix my PR. I rebased my PR on top of main branch, implemented your suggestion and added more test cases.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Apr 3, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants